<%@page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%>
<%@include file="/includes/taglibs.jsp"%>
<%@page import="com.feib.soeasy.model.MenuItem"%>
<%@page import="com.feib.soeasy.util.UserUtil"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.Set"%>
<%@page import="net.sourceforge.stripes.action.ActionBean"%>
<%

if (null != UserUtil.getUser() ){
    
    Map<MenuItem, Set<MenuItem>> menus = UserUtil.getUserMenuItems();
	MenuItem currentMenuItem = UserUtil.getCurrentMenuItem();

    if (null != menus && null != currentMenuItem)
    {
        out.println("<!-- ************** 第三層選單 start *************** -->");
	    out.println("<div id=\"thirdNavBlock\" >");
	    out.println("<ul>");
	    
    	Set<MenuItem> subMenus = menus.get(currentMenuItem.getParentMenuItem());
    	for(Iterator<MenuItem> i = subMenus.iterator(); i.hasNext();){
    	    
    	    MenuItem item = (MenuItem)i.next();
    	    request.setAttribute("item", item);
    	    
	    	if (item.equals(currentMenuItem))
		        request.setAttribute("activePageClass", "now");
		    else
		        request.setAttribute("activePageClass", "");
	    	%>
                <li class="<c:out value='${activePageClass}'/>" ><a href="<c:url value='${item.actionPage }'/>"><%=item.getActionName() %></a></li>
            <%
    	}


	    out.println("</ul>");
	    out.println("</div>");
	    out.println("<!-- ************** 第三層選單 end *************** -->");
    }
}
%>

				
